import request from '@/utils/request'

// 单位信息列表
  export function getCompanyList(data = {}) {
    return request({
      url: `/talent/TalentCompanyInfo/getList`,
      method: 'post',
      data
    })
  }

  //单位信息详情
  export function getCompanyDetail(id = '') {
    return request({
      url: `/talent/TalentCompanyInfo/${id}`,
      method: 'get',
    })
  }

  //人才列表
  export function getTalentList(data = {}) {
    return request({
      url: `/talent/TalentPersonInfo/getList`,
      method: 'post',
      data
    })
  }

  //人才详情
  export function getTalentDetail(id = '') {
    return request({
      url: `/talent/TalentPersonInfo/${id}`,
      method: 'get',
    })
  }

  //项目列表
  export function getProjectList(data = {}) {
    return request({
      url: `/talent/TalentProjectInfo/getList`,
      method: 'post',
      data
    })
  }
  
  //项目详情
  export function getProjectDetail(id = '') {
  return request({
    url: `/talent/TalentProjectInfo/${id}`,
    method: 'get',
  })
}

//联系人列表
export function getContactList(data = {}) {
  return request({
    url: `/talent/TalentCompanyContactInfo/getList`,
    method: 'post',
    data
  })
}


//字典
export function getDictSelect(type) {
  return request({
    url: `/system/DictionaryData/getDicListByType`,
    method: 'post',
    data: { dictionaryType: type }
  })
}

//修改单位信息
export function editCompanyInfo(data) {
  return request({
    url: `/talent/TalentCompanyInfo/${data.uscc}`,
    method: 'put',
    data
  })
}

//单位联系人列表

//联系人列表
export function getCompanyContactList(data = {}) {
  return request({
    url: `/talent/TalentCompanyContactInfo/getList`,
    method: 'post',
    data
  })
}

//修改单位联系人信息
export function editCompanyContact(data) {
  return request({
    url: `/talent/TalentCompanyContactInfo/${data.contactId}`,
    method: 'put',
    data
  })
}

//创建单位联系人

export function creatCompanyContact(data) {
  return request({
    url: `/talent/TalentCompanyContactInfo`,
    method: 'post',
    data
  })
}

//人才工作经历列表
export function getWorkHistoryList(data = {}) {
  return request({
    url: `/talent/TalentPersonWorkHistory/getList`,
    method: 'post',
    data
  })
}


//人员信息修改
export function editTalentPerson(data) {
  return request({
    url: `/talent/TalentPersonInfo/${data.personId}`,
    method: 'put',
    data
  })
}

//人才信息创建 talent/TalentPersonInfo
export function creatTalentPerson(data) {
  return request({
    url: `/talent/TalentPersonInfo`,
    method: 'post',
    data
  })
}

//工作经历修改
export function editWorkHistory(data) {
  return request({
    url: `/talent/TalentPersonWorkHistory/${data.historyId}`,
    method: 'put',
    data
  })
}

//工作经历创建
export function creatWorkHistory(data) {
  return request({
    url: `/talent/TalentPersonWorkHistory`,
    method: 'post',
    data
  })
}

//项目信息修改
export function editProject(data) {
  return request({
    url: `/talent/TalentProjectInfo/${data.projectId}`,
    method: 'put',
    data
  })
}


//创建项目信息

export function creatProject(data = {}) {
  return request({
    url: `/talent/TalentProjectInfo`,
    method: 'post',
    data
  })
}

//人才概况统计(id即companyId)
export function getTalentStatistics(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentProfile/${id}`,
    method: 'get',
  })
}

//人才学历分析(id即companyId)
export function getTalentEduChart(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentEduChartData/${id}`,
    method: 'get',
  })
}

//人才职称分析(id即companyId)
export function getTalentTitleChart(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentTitleChartData/${id}`,
    method: 'get',
  })
}

//行政区划
export function getOrigin() {
  return request({
    url: `/talent/TalentSystemInfo/getRegionOptions`,
    method: 'get',
  })
}

//审核---人才信息审核列表
export function getApproveTalentList(data = {}) {
  return request({
    url: `/talent/TalentPersonInfo/getAuditList`,
    method: 'post',
    data
  })
}

//审核---人才信息审核
export function approveTalent(data) {
  return request({
    url: `/talent/TalentPersonInfo/audit/${data.auditId}`,
    method: 'put',
    data
  })
}

//审核---人才信息审核详情（基本信息）
export function getTalentAuditInfo(id = '') {
  return request({
    url: `/talent/TalentPersonInfo/audit/${id}`,
    method: 'get',
  })
}

//获取当前用户信息
export function getUserInfo() {
  return request({
    url: `/oauth/CurrentUser`,
    method: 'get',
  })
}

//统计图-单位分布概况
export function getCompanyFbgk(data = {}) {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentCompanyByDistrict`,
    method: 'post',
    data
  })
}

//行业分布概况（重点产业）
export function getzdcy() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentCompanyByKeyIndustry`,
    method: 'post'
  })
}


//行业分布概况（行业）
export function gethyfbgk() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentCompanyByProfession`,
    method: 'post'
  })
}

//人员分布概况
export function getryfbgk() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentPersonByDistrict`,
    method: 'post'
  })
}

//学历分布概况
export function getrcxlfbgk() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentPersonByEduBackground`,
    method: 'post'
  })
}

//人才等级分布概况
export function getrcdjfbgk() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentPersonByEduLevel`,
    method: 'post'
  })
}

//项目分布概况
export function getProjectfbgk() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentProjectByDistrict`,
    method: 'post'
  })
}

//项目分布趋势
export function getProjectfbqs() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentProjectTrend`,
    method: 'post'
  })
}

//项目投资方向
export function getProjectInvestment() {
  return request({
    url: `/talent/TalentStatisticsForTaiZhengTong/getTalentProjectInvestment`,
    method: 'post'
  })
}

//获取泰州区级行政区划，获取泰州镇、街级行政区划(enCode)
export function getRegions(id = '') {
  return request({
    url: `/system/Area/regions/${id}`,
    method: 'get',
  })
}

//泰州行政区划级联数据
export function getTalentRegion() {
  return request({
    url: `/talent/TalentSystemInfo/getTalentRegionOptions`,
    method: 'get',
  })
}

//企业申请信息列表
export function companyApplyInfoList(data = {}) {
  return request({
    url: `/talent/TalentCompanyApplyInfo/getList`,
    method: 'post',
    data
  })
}  

//企业申请详情信息
export function getTalentCompanyApplyInfo(id = '') {
  return request({
    url: `/talent/TalentCompanyApplyInfo/${id}`,
    method: 'get',
  })
}

//企业申请信息审核
export function approveCompanyApply(data) {
  return request({
    url: `/talent/TalentCompanyApplyInfo/${data.applyId}`,
    method: 'put',
    data
  })
}